﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;

namespace SpiceNet.Circuits
{
    /// <summary>
    /// A class for keeping track of statistics
    /// </summary>
    public class Statistics
    {
        /// <summary>
        /// Number of total iterations performed
        /// </summary>
        public int NumIter { get; set; } = 0;

        /// <summary>
        /// Number of iterations for transient analysis
        /// </summary>
        public int TranIter { get; set; } = 0;

        /// <summary>
        /// Number of iterations at the end of the last point
        /// Used to compute iterations per point
        /// </summary>
        public int OldIter { get; set; } = 0;

        /// <summary>
        /// Total number of timepoints
        /// </summary>
        public int TimePts { get; set; } = 0;

        /// <summary>
        /// Number of timepoints accepted
        /// </summary>
        public int Accepted { get; set; } = 0;

        /// <summary>
        /// Number of timepoints rejected
        /// </summary>
        public int Rejected { get; set; } = 0;

        /// <summary>
        /// Total time for analysis
        /// </summary>
        public Stopwatch TotalAnalysisTime { get; } = new Stopwatch();

        /// <summary>
        /// Transient analysis time
        /// </summary>
        public Stopwatch TranTime { get; } = new Stopwatch();

        /// <summary>
        /// Time spent in device loading
        /// </summary>
        public Stopwatch LoadTime { get; } = new Stopwatch();

        /// <summary>
        /// Total time spent solving matrices
        /// </summary>
        public Stopwatch SolveTime { get; } = new Stopwatch();

        /// <summary>
        /// Total time spent in transient solving matrices
        /// </summary>
        public TimeSpan TranSolveTime { get; set; } = new TimeSpan();
    }
}
